
public class CallExpr {
	String id;
	String lp;
	ActualParams ap;
	String rp;
	
	public CallExpr (String id, String lp, ActualParams ap, String rp){
		this.id = id;
		this.lp = lp;
		this.ap = ap;
		this.rp = rp;
	}
	public String toString(){
		String ret = "CallExpr "+id+"\n";

		String s = "";
		if (ap != null) {
			s += ap.toString();
		}
		for(String st: s.split("\n"))
			ret += "| " + st + "\n";
		return ret;
	}
	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		// //System.out.println("CallExpr " + id + " " + lp + " " + rp);
		if (!table.containsMethod(id)) {
			throw new SemanticException("Method not available");
		} else if (table.containsMethod(id)) {
			// compare params
			// //System.out.println("CompareParams " + ap.pap.exp);
			ap.check();
		}
	}
}
